package com.longxi.tianjintianbao.ui.dialog_fragment;

import android.widget.LinearLayout;
import android.widget.TextView;

import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.ui.activity.quality.QualityClassListActivity;
import com.longxi.tianjintianbao.ui.base.BaseDialogFragment;
import com.longxi.tianjintianbao.ui.presenter.quality.QualityStateDfgPresenter;
import com.longxi.tianjintianbao.ui.view.quality.IQualityStateDfgView;

import butterknife.BindView;

public class QualityStateDialogFragment extends BaseDialogFragment<IQualityStateDfgView, QualityStateDfgPresenter> implements IQualityStateDfgView {

    @BindView(R.id.tvPerson)
    TextView mTvPerson;
    @BindView(R.id.tvLastdate)
    TextView mTvLastdate;
    @BindView(R.id.btnLogin)
    TextView mBtnLogin;

    @Override
    public void initData() {
        super.initData();
        mPresenter.setBar();
    }

    @Override
    public void initListener() {
        super.initListener();
        mTvPerson.setOnClickListener(v -> mPresenter.getDepartment(false));
        mTvLastdate.setOnClickListener(v -> mPresenter.getDate(getTvLastdate()));
        mBtnLogin.setOnClickListener(v -> mPresenter.getQualityClassListActivity().saveQualityState("2", getTvLastdate().getText().toString().trim()));
    }

    @Override
    protected int provideContentViewId() {
        return R.layout.dialog_fragment_quality_state;
    }

    @Override
    protected QualityStateDfgPresenter createPresenter() {
        return new QualityStateDfgPresenter((QualityClassListActivity)getActivity(), this);
    }

    @Override
    public TextView getTvPerson() {
        return mTvPerson;
    }

    @Override
    public TextView getTvLastdate() {
        return mTvLastdate;
    }

}
